package com.capgemini.orf.datamodel;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import com.google.appengine.api.datastore.Key;

@Entity
public class Project {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Key id;
	private String name;
	private String code;
	private String unit;
	private Date startDate;
	private Date endDate;

	@Enumerated
	private ProjectType projectType;

	@Enumerated
	private TransversalLine transversalLine;

	@Enumerated
	private DeliveryUnit deliveryUnit;

	private String accountManager;
	private String engagementManager;
	private String deliveryManager;
	private BigDecimal fixedPriceAmount;
	private BigDecimal volumeDiscount;
	private String invoiceReference;
	private String invoiceAppendix;
	private boolean poNeeded;

	@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
	private List<Resource> resources;

	public Key getKey() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public ProjectType getProjectType() {
		return projectType;
	}

	public void setProjectType(ProjectType projectType) {
		this.projectType = projectType;
	}

	public TransversalLine getTransversalLine() {
		return transversalLine;
	}

	public void setTransversalLine(TransversalLine transversalLine) {
		this.transversalLine = transversalLine;
	}

	public DeliveryUnit getDeliveryUnit() {
		return deliveryUnit;
	}

	public void setDeliveryUnit(DeliveryUnit deliveryUnit) {
		this.deliveryUnit = deliveryUnit;
	}

	public String getAccountManager() {
		return accountManager;
	}

	public void setAccountManager(String accountManager) {
		this.accountManager = accountManager;
	}

	public String getEngagementManager() {
		return engagementManager;
	}

	public void setEngagementManager(String engagementManager) {
		this.engagementManager = engagementManager;
	}

	public String getDeliveryManager() {
		return deliveryManager;
	}

	public void setDeliveryManager(String deliveryManager) {
		this.deliveryManager = deliveryManager;
	}

	public BigDecimal getFixedPriceAmount() {
		return fixedPriceAmount;
	}

	public void setFixedPriceAmount(BigDecimal fixedPriceAmount) {
		this.fixedPriceAmount = fixedPriceAmount;
	}

	public BigDecimal getVolumeDiscount() {
		return volumeDiscount;
	}

	public void setVolumeDiscount(BigDecimal volumeDiscount) {
		this.volumeDiscount = volumeDiscount;
	}

	public String getInvoiceReference() {
		return invoiceReference;
	}

	public void setInvoiceReference(String invoiceReference) {
		this.invoiceReference = invoiceReference;
	}

	public String getInvoiceAppendix() {
		return invoiceAppendix;
	}

	public void setInvoiceAppendix(String invoiceAppendix) {
		this.invoiceAppendix = invoiceAppendix;
	}

	public boolean isPoNeeded() {
		return poNeeded;
	}

	public void setPoNeeded(boolean poNeeded) {
		this.poNeeded = poNeeded;
	}

	public List<Resource> getResources() {
		return resources;
	}

	public void setResources(List<Resource> resources) {
		this.resources = resources;
	}

}
